public class Main {
    public static void main(String[] args) {

        Component L1 = new ComponentComposite("北京总部");
        Component Leaf_1_1 = new ComponentLeaf("北京教务办公室");
        Component L_1_2 = new ComponentComposite("湖南分校");
        Component Leaf_1_3 = new ComponentLeaf("北京行政办公室");

        L1.addChild(Leaf_1_1);
        L1.addChild(Leaf_1_3);
        L1.addChild(L_1_2);

        Component Leaf_2_1 = new ComponentLeaf("湖南教务办公室");
        Component L_2_2 = new ComponentComposite("长沙教学点");
        Component L_2_3 = new ComponentComposite("湘潭教学点");
        Component Leaf_2_4 = new ComponentLeaf("湖南行政办公室");

        L_1_2.addChild(Leaf_2_1);
        L_1_2.addChild(Leaf_2_4);
        L_1_2.addChild(L_2_2);
        L_1_2.addChild(L_2_3);

        //为了区分各级教务办公室和行政办公室，这里在办公室前面增加层级注释
        Component Leaf_3_1 = new ComponentLeaf("长沙教务办公室");
        Component Leaf_3_2 = new ComponentLeaf("长沙行政办公室");
        Component Leaf_4_1 = new ComponentLeaf("湘潭教务办公室");
        Component Leaf_4_2 = new ComponentLeaf("湘潭行政办公室");
        L_2_2.addChild(Leaf_3_1);
        L_2_2.addChild(Leaf_3_2);
        L_2_3.addChild(Leaf_4_1);
        L_2_3.addChild(Leaf_4_2);
        //下发公文
        String document = "春节放假通知";
        L1.operation(document);
    }
}